//
//  StatusNormalCell.swift
//  XinLangWeiBo
//
//  Created by mac on 15/11/12.
//  Copyright © 2015年 mac. All rights reserved.
//

import UIKit

class StatusNormalCell: StatusCell {
    //微博视图模型
  override  var viewModel: StatusViewModel? {
        didSet{
            //更新约束
            pictureView.snp_updateConstraints { (make) -> Void in
                //根据配图数量决定试图顶部的间距
                let offset = viewModel?.thumbnailUrls?.count > 0 ? StatusCellMargin : 0
                    make.top.equalTo(contentLabel.snp_bottom).offset(offset)

            }
        }
    }

    override func setupUI() {
        // 3>配图视图
        super.setupUI()
        pictureView.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(contentLabel.snp_bottom).offset(StatusCellMargin)
            make.left.equalTo(contentLabel.snp_left)
            make.width.equalTo(300)
            make.height.equalTo(90)
        }
    }



}